package KK.Controls.Tips 
{
	import KK.Hunter.Window.IWindow;
	
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;

	public class ExTip extends BaseBox
	{
		private var text:TextField;
		public function ExTip()
		{
			//TODO: implement function
			super(300,300);
			init();
		}
		/**
		 * 初始化  
		 * 
		 */
		private function init():void{
			text=new TextField();
			
			text.wordWrap=true;
			text.selectable=false;
			
			text.textColor=0xFFFFFFFF;
			text.height=12; 
			text.autoSize=TextFieldAutoSize.LEFT;
			text.y=5;
			text.x=5;
			addChild(text);
		}
		
		/**
		 * 显示消息  
		 * @param msg
		 * 
		 */
		public function ShowMsg(msg:String,follow:Boolean=true):void{
			if(!sheet){
				return ;
			}
			text.htmlText=msg;
			setSize(text.textWidth+15,text.textHeight+10);
			Show();
		}
		
		
		/**
		 * 显示 
		 * 
		 */
		public function Show():void{
			
			text.cacheAsBitmap=true;
			visible=true;
		}
		
		/**
		 * 
		 * 
		 */
		public function Hide():void{
			
//			text.cacheAsBitmap=true;
			visible=false;
			
		}
		
		public function get textWidth():uint{
			return text.textWidth+15;
		}
		
		public function get textHeight():uint{
			return text.textHeight+10;
		}
	}
}